package com.qfmy.baseCode.builder;

import com.qfmy.baseCode.consts.PathAndPackageConst;
import com.qfmy.baseCode.utils.CommentUtils;
import lombok.Cleanup;
import lombok.SneakyThrows;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;

/**
 * @author: 廖志伟
 * @date: 2024-11-26
 * @description: 构建者配置类
 */
@SuppressWarnings("all")
public class BuilderConfig {
    //配置文件路径
    private String configPath;
    //登入的方式
    private String loginType;
    //图片上传的方式
    private String uploadType;
    //公共类所在的配置路径
    private String commonPath;
    //主程序所在的包
    private String mainPackage;
    //主程序所在的路径
    private String mainPath;
    //登入接口的路径
    private String loginPath;
    //项目的名称
    private String projectName;
    //公共项目的名称
    private String commonProjectName;
    //公共包
    private String commonPackage;
    //基础包
    private String basePackage;
    //定义一个夫类的名称
    private  String parentName;
    //父项目所在的包
    private String parentPackage;
    //注册的方式
    private String registerType;

    @Contract(pure = true)
    public BuilderConfig(String loginType, String uploadType, @NotNull String mainPackage, String projectName, String loginPath,String commonPackage,String basePackage ,String commonProjectName,String parentName,String parentPackage,String registerType) {
        this.loginPath = loginPath;
        this.loginType = loginType;
        this.uploadType = uploadType;
        this.mainPackage = mainPackage;
        this.mainPath = PathAndPackageConst.PATH_BASE + mainPackage.replace(".", "/");
        this.commonPackage = commonPackage;
        this.basePackage = basePackage;
        this.parentName = parentName;
        this.configPath =  parentName + "/" + projectName + "/src/main/resources";
        this.commonPath = parentName + "/" + commonProjectName + "/src/main/resources";
        this.parentPackage = parentPackage;
        this.projectName = projectName;
        this.commonProjectName =  commonProjectName;
        this.registerType = registerType;
    }

    /**
     * 执行构建者配置
     */
    @SneakyThrows
    public void execute() {
        //生成application.yml文件
        writeApplicationYml();
        //生成common.yml文件
        writeCommonYml();
        //生成启动类
        writeMain();
        //创建base的pom文件
        writeBasePom();
        //创建common的pom文件
        writeCommonPom();
        //创建项目的pom文件
        parentNamePom();
    }




    /**
     * 编写application.xml文件
     * @param mysqlConfig
     * @param bw
     */
    @SneakyThrows
    public void writeApplicationYml() {
        //创建文件夹
        File file = new File(configPath);
        //判断文件是否存在
        if(!file.exists())
        {
            //创建文件
            file.mkdirs();
        }
        //创建配置文件
        File configFile = new File(file, "application.yml");
        //输入流对象
        @Cleanup FileOutputStream fos = new FileOutputStream(configFile);
        @Cleanup OutputStreamWriter os = new OutputStreamWriter(fos);
        @Cleanup BufferedWriter bw = new BufferedWriter(os);
        bw.write("#配置端口\n");
        bw.write("server:\n");
        bw.write("  port: 8081\n");
        bw.write("#配置数据库\n");
        bw.write("spring:\n");
        bw.write("  datasource:\n");
        bw.write("    url: \n");
        bw.write("    username: \n");
        bw.write("    password: \n");
        bw.write("    driver-class-name: \n");
        bw.write("#配置redis\n");
        bw.write("  data:\n");
        bw.write("    redis:\n");
        bw.write("      host: \n");
        bw.write("      port: \n");
        bw.write("      password: \n");
        //判断登入的方式
        if("2".equals(loginType)){
            bw.write("#配置阿里云的短信验证\n");
            bw.write("aliyun:\n");
            bw.write("  sms:\n");
            bw.write("    accessKeyId: \n");
            bw.write("    secretAccessKey: \n");
            bw.write("    endpoint: \n");
        }
        bw.write("#配置mybatis\n");
        bw.write("mybatis:\n");
        bw.write("  mapper-locations: classpath:/mapper/*.xml\n");
        bw.write("#开启驼峰命名规则映射即从数据库列名到Java属性名的命名类型转换\n");
        bw.write("  configuration:\n");
        bw.write("    map-underscore-to-camel-case: true\n");
        bw.flush();
    }

    /**
     * 编写common.yml文件
     */
    @SneakyThrows
    public void writeCommonYml() {
        //编写application.yml文件
        //创建文件夹
        File file = new File(commonPath);
        //判断文件是否存在
        if(!file.exists())
        {
            //创建文件
            file.mkdirs();
        }
        //创建配置文件
        File configFile = new File(file, "application.yml");
        //输入流对象
        @Cleanup FileOutputStream fos = new FileOutputStream(configFile);
        @Cleanup OutputStreamWriter os = new OutputStreamWriter(fos);
        @Cleanup BufferedWriter bw = new BufferedWriter(os);
        //判断文件上传的方式
        if("minio".equals(uploadType)){
            bw.write("#配置minio\n");
            bw.write("minio:\n");
            bw.write("  endpoint:\n");
            bw.write("  accessKey: \n");
            bw.write("  secretKey: \n");
            bw.write("  bucketName: \n");
        }
        //判断是否是邮箱注册
        if("3".equals(registerType)){
            bw.write("  #邮箱注册\n");
            bw.write("spring:\n" +
                    "  mail:\n" +
                    "    # 配置邮件服务器的地址 smtp.qq.com\n" +
                    "    host: smtp.qq.com\n" +
                    "    port: 456\n" +
                    "    username: \n" +
                    "    password: \n" +
                    "    default-encoding: UTF-8\n" +
                    "    properties:\n" +
                    "      mail:\n" +
                    "        smtp:\n" +
                    "          debug=true:\n" +
                    "          socketFactory.class: javax.net.ssl.SSLSocketFactory  ");
        }

    }

    /**
     * 编写启动类
     */
    @SneakyThrows
    public void writeMain() {
        //创建文件夹
        File file = new File(mainPath);
        if(!file.exists())
        {
            //创建文件
            file.mkdirs();
        }
        File mainFile = null;
        //构建主程序的类
        if("/app/login".equals(loginPath))
        {
            mainFile = new File(file, "App" + projectName + "Application.java");
        }
        else
        {
            mainFile = new File(file, "Admin" + projectName + "Application.java");
        }
        //输入流对象
        @Cleanup FileOutputStream fos = new FileOutputStream(mainFile);
        @Cleanup OutputStreamWriter os = new OutputStreamWriter(fos);
        @Cleanup BufferedWriter bw = new BufferedWriter(os);
        //编写启动类
        bw.write("package " + mainPackage + ";\n");
        bw.write("import org.springframework.boot.SpringApplication;\n");
        bw.write("import org.springframework.boot.autoconfigure.SpringBootApplication;\n");
        bw.write("import org.springframework.context.annotation.ComponentScan;\n");
        bw.write("import org.springframework.scheduling.annotation.EnableAsync;\n");
        bw.write("import org.springframework.transaction.annotation.EnableTransactionManagement;\n");
        bw.write("import org.springframework.scheduling.annotation.EnableScheduling;\n");
        //生成注释
        CommentUtils.CreateClassComment(bw,projectName + "的启动类");
        bw.write("@SpringBootApplication\n");
        bw.write("@EnableAsync//开启全局异步请求\n");
        bw.write("@EnableTransactionManagement//开启全局事务管理\n");
        bw.write("@EnableScheduling//开启定时任务\n");
        bw.write("@ComponentScan(\"" + commonPackage + "\")//扫描公共的模块\n");
        bw.write("@SuppressWarnings(\"all\")\n");
        if("/app/login".equals(loginPath))
        {
            bw.write("public class App" + projectName + "Application {\n");
        }
        else
        {
            bw.write("public class Admin" + projectName + "Application {\n");
        }
        bw.write("\tpublic static void main(String[] args) {\n");
        if("/app/login".equals(loginPath))
        {
            bw.write("        SpringApplication.run(App" + projectName + "Application.class,args);\n");
            bw.write("\t}\n");
        }
        else {
            bw.write("        SpringApplication.run(Admin" + projectName + "Application.class,args);\n");
            bw.write("\t}\n");
        }
        bw.write("}\n");

    }

    /**
     * 创建主类的pom.xml文件
     */
    @SneakyThrows
    private void writeBasePom() {
        //创建文件夹
        File file = new File(parentName + "/" +  projectName);
        //判断文件是否存在
        if (!file.exists()) {
            //创建文件
            file.createNewFile();
        }
        //创建配置文件
        File configFile = new File(file, "pom.xml");
        //输入流对象
        @Cleanup FileOutputStream fos = new FileOutputStream(configFile);
        @Cleanup OutputStreamWriter os = new OutputStreamWriter(fos);
        @Cleanup BufferedWriter bw = new BufferedWriter(os);
        bw.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
                "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
                "         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n" +
                "    <modelVersion>4.0.0</modelVersion>\n" +
                "    <parent>\n" +
                "        <groupId>"+parentPackage.substring(0,parentPackage.lastIndexOf("."))+"</groupId>\n" +
                "        <artifactId>"+parentName+"</artifactId>\n" +
                "        <version>1.0-SNAPSHOT</version>\n" +
                "        <relativePath/>\n" +
                "    </parent>\n");
        bw.write("    <artifactId>"+projectName+"</artifactId>\n" );
        bw.write(" <properties>\n" +
                "        <maven.compiler.source>17</maven.compiler.source>\n" +
                "        <maven.compiler.target>17</maven.compiler.target>\n" +
                "        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n" );
                bw.write("    </properties>\n" );
                bw.write("<dependencies>\n" );
                bw.write("<!--        springboot依赖-->\n" +
                        "        <dependency>\n" +
                        "            <groupId>org.springframework.boot</groupId>\n" +
                        "            <artifactId>spring-boot-starter</artifactId>\n" +
                        "        </dependency>\n" +
                        "<!--        springboot测试依赖-->\n" +
                        "        <dependency>\n" +
                        "            <groupId>com.fasterxml.jackson.core</groupId>\n" +
                        "            <artifactId>jackson-annotations</artifactId>\n" +
                        "             <version>2.15.2</version>\n" +
                        "        </dependency>\n" +
                        "<!--        web依赖-->\n" +
                        "        <dependency>\n" +
                        "            <groupId>org.springframework.boot</groupId>\n" +
                        "            <artifactId>spring-boot-starter-web</artifactId>\n" +
                        "        </dependency>\n" +
                        "<!--        mysql驱动依赖-->\n" +
                        "        <dependency>\n" +
                        "            <groupId>com.mysql</groupId>\n" +
                        "            <artifactId>mysql-connector-j</artifactId>\n" +
                        "            <scope>runtime</scope>\n" +
                        "        </dependency>\n" +
                       "         <!-- 引用公共类所在的模块-->\n" +
                        "           <dependency>\n" +
                         "               <groupId>"+commonPackage.substring(0,commonPackage.lastIndexOf("."))+"</groupId>\n" +
                         "               <artifactId>"+commonProjectName+"</artifactId>\n" +
                        "                <version>1.0-SNAPSHOT</version>" +
                          "         </dependency>\n" +
                        "<!--        mybatis依赖-->\n" +
                        "        <dependency>\n" +
                        "            <groupId>org.springframework.boot</groupId>\n" +
                        "            <artifactId>spring-boot-starter-jdbc</artifactId>\n" +
                        "        </dependency>\n" +
                        "        <dependency>\n" +
                        "            <groupId>org.mybatis.spring.boot</groupId>\n" +
                        "            <artifactId>mybatis-spring-boot-starter</artifactId>\n" +
                        "            <version>3.0.3</version>\n" +
                        "        </dependency>\n" +
                        "<!--        mybatis测试依赖-->\n" +
                        "        <dependency>\n" +
                        "            <groupId>org.mybatis.spring.boot</groupId>\n" +
                        "            <artifactId>mybatis-spring-boot-starter-test</artifactId>\n" +
                        "            <version>3.0.3</version>\n" +
                        "            <scope>test</scope>\n" +
                        "        </dependency>\n" +
                        "\n" +
                        "        <!--knife4j文档-->\n" +
                        "        <!--官方文档：https://doc.xiaominfo.com/docs/quick-start -->\n" +
                        "        <dependency>\n" +
                        "            <groupId>com.github.xiaoymin</groupId>\n" +
                        "            <artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>\n" +
                        "            <version>4.1.0</version>\n" +
                        "        </dependency>\n" +
                        "<!--       图形验证码依赖 -->\n" +
                        "        <dependency>\n" +
                        "            <groupId>com.github.whvcse</groupId>\n" +
                        "            <artifactId>easy-captcha</artifactId>\n" +
                        "            <version>1.6.2</version>\n" +
                        "        </dependency>\n" +
                        "<!--        mybatis-plus依赖-->\n" +
                        "        <dependency>\n" +
                        "               <groupId>com.baomidou</groupId>\n" +
                        "               <artifactId>mybatis-plus-boot-starter</artifactId>\n" +
                        "               <version>3.5.3.1</version>\n" +
                        "           </dependency>\n" +
                        "\n" +
                        "\n");
                //判断是否与需要邮箱注册
        if("3".equals(registerType)){
            bw.write("<!--        邮箱注册依赖-->\n" +
                    "    <dependency>\n" +
                    "        <groupId>com.sun.mail</groupId>\n" +
                    "        <artifactId>jakarta.mail</artifactId>\n" +
                    "        <version>2.0.1</version>\n" +
                    "    </dependency>\n" );
        }
        bw.write("    </dependencies>\n");
                bw.write(" <build>\n" +
                        "        <plugins>\n" +
                        "            <plugin>\n" +
                        "                <groupId>org.springframework.boot</groupId>\n" +
                        "                <artifactId>spring-boot-maven-plugin</artifactId>\n" +
                        "                <configuration>\n" +
                        "                    <excludes>\n" +
                        "                        <exclude>\n" +
                        "                            <groupId>org.projectlombok</groupId>\n" +
                        "                            <artifactId>lombok</artifactId>\n" +
                        "                        </exclude>\n" +
                        "                    </excludes>\n" +
                        "                </configuration>\n" +
                        "            </plugin>\n" +
                        "        </plugins>\n" +
                        "    </build>\n" +
                        "</project>");
    }


    /**
     * 创建common的pom.xml文件
     */
    @SneakyThrows
    private void writeCommonPom() {
        //创建文件夹
        File file = new File(parentName + "/" + commonProjectName);
        //判断文件是否存在
        if (!file.exists()) {
            //创建文件
            file.createNewFile();
        }
        //创建配置文件
        File configFile = new File(file, "pom.xml");
        //输入流对象
        @Cleanup FileOutputStream fos = new FileOutputStream(configFile);
        @Cleanup OutputStreamWriter os = new OutputStreamWriter(fos);
        @Cleanup BufferedWriter bw = new BufferedWriter(os);
        bw.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
                "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
                "         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n" +
                "    <modelVersion>4.0.0</modelVersion>\n" +
                "    <parent>\n" +
                "        <groupId>"+parentPackage.substring(0,parentPackage.lastIndexOf("."))+"</groupId>\n" +
                "        <artifactId>"+parentName+"</artifactId>\n" +
                "        <version>1.0-SNAPSHOT</version>\n" +
                "        <relativePath/>\n" +
                "    </parent>\n");
        bw.write("    <artifactId>"+commonProjectName+"</artifactId>\n" );
        bw.write(" <properties>\n" +
                "        <maven.compiler.source>17</maven.compiler.source>\n" +
                "        <maven.compiler.target>17</maven.compiler.target>\n" +
                "        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n" );
        bw.write("    </properties>\n" );
        bw.write("    <dependencies>\n" );
        bw.write("<!--        lombok依赖-->\n" +
                "        <dependency>\n" +
                "            <groupId>org.projectlombok</groupId>\n" +
                "            <artifactId>lombok</artifactId>\n" +
                "            <version>1.18.30</version>\n" +
                "            <scope>provided</scope>\n" +
                "        </dependency>\n" +
                "<!--        redis依赖-->\n" +
                "        <dependency>\n" +
                "            <groupId>org.springframework.boot</groupId>\n" +
                "            <artifactId>spring-boot-starter-data-redis</artifactId>\n" +
                "        </dependency>\n" +
                "        <!--        swagger依赖-->\n" +
                "        <dependency>\n" +
                "            <groupId>org.jetbrains</groupId>\n" +
                "            <artifactId>annotations</artifactId>\n" +
                "            <version>24.1.0</version>\n" +
                "            <scope>compile</scope>\n" +
                "        </dependency>\n" +
                "        <!--JWT登录认证相关-->\n" +
                "        <!--官方文档：https://github.com/jwtk/jjwt#install-jdk-maven -->\n" +
                "        <dependency>\n" +
                "            <groupId>io.jsonwebtoken</groupId>\n" +
                "            <artifactId>jjwt-api</artifactId>\n" +
                "            <version>0.11.2</version>\n" +
                "        </dependency>\n" +
                "        <dependency>\n" +
                "            <groupId>io.jsonwebtoken</groupId>\n" +
                "            <artifactId>jjwt-impl</artifactId>\n" +
                "            <version>0.11.2</version>\n" +
                "            <scope>runtime</scope>\n" +
                "        </dependency>\n" +
                "        <dependency>\n" +
                "            <groupId>io.jsonwebtoken</groupId>\n" +
                "            <artifactId>jjwt-jackson</artifactId>\n" +
                "            <version>0.11.2</version>\n" +
                "            <scope>runtime</scope>\n" +
                "        </dependency>\n" +
                "<!--        web依赖-->\n" +
                "        <dependency>\n" +
                "            <groupId>org.springframework</groupId>\n" +
                "            <artifactId>spring-web</artifactId>\n" +
                "            <version>6.1.14</version>\n" +
                "            <scope>compile</scope>\n" +
                "        </dependency>\n" +
                "<!--        springboot依赖    -->\n" +
                "        <dependency>\n" +
                "            <groupId>org.springframework.boot</groupId>\n" +
                "            <artifactId>spring-boot</artifactId>\n" +
                "            <version>3.3.5</version>\n" +
                "            <scope>compile</scope>\n" +
                "        </dependency>\n" +
                "<!--        jakarta注解依赖-->\n" +
                "        <dependency>\n" +
                "            <groupId>jakarta.annotation</groupId>\n" +
                "            <artifactId>jakarta.annotation-api</artifactId>\n" +
                "            <version>2.1.1</version>\n" +
                "            <scope>compile</scope>\n" +
                "        </dependency>\n" +
                "<!--        阿里云短信服务依赖-->\n" +
                "        <dependency>\n" +
                "            <groupId>com.aliyun</groupId>\n" +
                "            <artifactId>dysmsapi20170525</artifactId>\n" +
                "            <version>2.0.23</version>\n" +
                "        </dependency>\n" +
                "<!--        minio依赖-->\n" +
                "        <dependency>\n" +
                "            <groupId>io.minio</groupId>\n" +
                "            <artifactId>minio</artifactId>\n" +
                "           <version>8.5.12</version>\n" +
                "        </dependency>\n" +
                "<!--        springboot自动配置依赖-->\n" +
                "        <dependency>\n" +
                "            <groupId>org.springframework.boot</groupId>\n" +
                "            <artifactId>spring-boot-autoconfigure</artifactId>\n" +
                "            <version>3.3.5</version>\n" +
                "            <scope>compile</scope>\n" +
                "        </dependency>\n" +
                "        </dependencies>\n");
        bw.write(" <build>\n" +
                "        <plugins>\n" +
                "            <plugin>\n" +
                "                <groupId>org.springframework.boot</groupId>\n" +
                "                <artifactId>spring-boot-maven-plugin</artifactId>\n" +
                "                <configuration>\n" +
                "                    <excludes>\n" +
                "                        <exclude>\n" +
                "                            <groupId>org.projectlombok</groupId>\n" +
                "                            <artifactId>lombok</artifactId>\n" +
                "                        </exclude>\n" +
                "                    </excludes>\n" +
                "                </configuration>\n" +
                "            </plugin>\n" +
                "        </plugins>\n" +
                "    </build>\n" +
                "</project>");
    }

    /**
     * 生成pom.xml文件
     */
    @SneakyThrows
    public void parentNamePom()
    {
      //创建文件夹
        File file = new File(parentName);
        //判断文件是否存在
        if (!file.exists()) {
            //创建文件
            file.createNewFile();
        }
        //创建配置文件
        File configFile = new File(file, "pom.xml");
        //输入流对象
        @Cleanup FileOutputStream fos = new FileOutputStream(configFile);
        @Cleanup OutputStreamWriter os = new OutputStreamWriter(fos);
        @Cleanup BufferedWriter bw = new BufferedWriter(os);
        bw.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
                "<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n" +
                "         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
                "         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n" +
                "    <modelVersion>4.0.0</modelVersion>\n");
        bw.write("    <groupId>" + parentPackage.substring(0,parentPackage.lastIndexOf(".")) + "</groupId>\n" );
        bw.write("    <artifactId>" + parentName + "</artifactId>\n" );
        bw.write("    <version>1.0-SNAPSHOT</version>" +"\n" +
                "            <packaging>pom</packaging>\n" );
        bw.write("    <modules>\n" +
                "        <module>"+projectName+"</module>\n" +
                "        <module>"+commonProjectName+"</module>\n" +
                "    </modules>\n");
        bw.write("\n" +
                "    <!-- 继承Spring Boot父项目 -->\n" +
                "    <parent>\n" +
                "        <groupId>org.springframework.boot</groupId>\n" +
                "        <artifactId>spring-boot-starter-parent</artifactId>\n" +
                "        <version>3.0.5</version>\n" +
                "    </parent>\n" +
                "\n" +
                "    <!-- 注意：直接替换pom文件中原有的properties -->\n" +
                "    <properties>\n" +
                "        <maven.compiler.source>17</maven.compiler.source>\n" +
                "        <maven.compiler.target>17</maven.compiler.target>\n" +
                "        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n" +
                "        <mybatis-plus.version>3.5.3.1</mybatis-plus.version>\n" +
                "        <swagger.version>2.9.2</swagger.version>\n" +
                "        <jwt.version>0.11.2</jwt.version>\n" +
                "        <easycaptcha.version>1.6.2</easycaptcha.version>\n" +
                "        <minio.version>8.2.0</minio.version>\n" +
                "        <redis.version>3.4.0</redis.version>\n" +
                "        <knife4j.version>4.1.0</knife4j.version>\n" +
                "        <aliyun.sms.version>2.0.23</aliyun.sms.version>\n" +
                "    </properties>\n" +
                "\n" +
                "    <!--配置dependencyManagement统一管理依赖版本-->\n" +
                "    <dependencyManagement>\n" +
                "        <dependencies>\n" +
                "            <!--mybatis-plus-->\n" +
                "            <!--官方文档：https://baomidou.com/pages/bab2db/ -->\n" +
                "            <dependency>\n" +
                "                <groupId>com.baomidou</groupId>\n" +
                "                <artifactId>mybatis-plus-boot-starter</artifactId>\n" +
                "                <version>${mybatis-plus.version}</version>\n" +
                "            </dependency>\n" +
                "\n" +
                "            <!--knife4j文档-->\n" +
                "            <!--官方文档：https://doc.xiaominfo.com/docs/quick-start -->\n" +
                "            <dependency>\n" +
                "                <groupId>com.github.xiaoymin</groupId>\n" +
                "                <artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>\n" +
                "                <version>${knife4j.version}</version>\n" +
                "            </dependency>\n" +
                "\n" +
                "            <!--JWT登录认证相关-->\n" +
                "            <!--官方文档：https://github.com/jwtk/jjwt#install-jdk-maven -->\n" +
                "            <dependency>\n" +
                "                <groupId>io.jsonwebtoken</groupId>\n" +
                "                <artifactId>jjwt-api</artifactId>\n" +
                "                <version>${jwt.version}</version>\n" +
                "            </dependency>\n" +
                "            <dependency>\n" +
                "                <groupId>io.jsonwebtoken</groupId>\n" +
                "                <artifactId>jjwt-impl</artifactId>\n" +
                "                <scope>runtime</scope>\n" +
                "                <version>${jwt.version}</version>\n" +
                "            </dependency>\n" +
                "            <dependency>\n" +
                "                <groupId>io.jsonwebtoken</groupId>\n" +
                "                <artifactId>jjwt-jackson</artifactId>\n" +
                "                <scope>runtime</scope>\n" +
                "                <version>${jwt.version}</version>\n" +
                "            </dependency>\n" +
                "\n" +
                "            <!--图形验证码-->\n" +
                "            <!--官方文档：https://gitee.com/ele-admin/EasyCaptcha -->\n" +
                "            <dependency>\n" +
                "                <groupId>com.github.whvcse</groupId>\n" +
                "                <artifactId>easy-captcha</artifactId>\n" +
                "                <version>${easycaptcha.version}</version>\n" +
                "            </dependency>\n" +
                "\n" +
                "            <!--对象存储，用于存储图像等非结构化数据-->\n" +
                "            <!--官方文档：https://min.io/docs/minio/linux/developers/minio-drivers.html?ref=docs#java-sdk -->\n" +
                "            <dependency>\n" +
                "                <groupId>io.minio</groupId>\n" +
                "                <artifactId>minio</artifactId>\n" +
                "                <version>${minio.version}</version>\n" +
                "            </dependency>\n" +
                "       <!--        redis依赖-->\n" +
                "            <dependency>\n" +
                "                <groupId>org.springframework.boot</groupId>\n" +
                "                <artifactId>spring-boot-starter-data-redis</artifactId>\n" +
                "               <version>${redis.version}</version>\n" +
                "            </dependency>\n" +
                "            <!--阿里云短信客户端，用于发送短信验证码-->\n" +
                "            <!--官方文档：https://help.aliyun.com/document_detail/215759.html?spm=a2c4g.215759.0.0.49f32807f4Yc0y -->\n" +
                "            <dependency>\n" +
                "                <groupId>com.aliyun</groupId>\n" +
                "                <artifactId>dysmsapi20170525</artifactId>\n" +
                "                <version>${aliyun.sms.version}</version>\n" +
                "            </dependency>\n" +
                "        </dependencies>\n" +
                "    </dependencyManagement>\n" +
                "</project>");

    }

}
